﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverApp.ViewModel
{
    public class FolderItemViewModel : ViewModelBase
    {
        private LiveService.Folder      model;
        private FolderViewModel         parent;

        public FolderItemViewModel(LiveService.Folder xmodel, FolderViewModel xparent)
        {
            model = xmodel;
            parent = xparent;
        }

        public FolderItemViewModel(FolderItemViewModel xcopy)
        {
            model = xcopy.model;
            parent = xcopy.parent;
        }

        public LiveService.Folder Model
        {
            get { return this.model;}
            set { this.model = value;}
        }

        public String ModelName
        {
            get { return this.Model.name; }
            set { this.Model.name = value; }
        }

        public String ModelSize
        {
            get { return this.Model.size.ToString(); }
        }

        public String ModelType
        {
            get { return "File Folder"; }
        }

        public String ModelCreatedon
        {
            get { return this.Model.createdon.ToString(); }
        }

        public ICommand EnterMyFolderCommand
        {
            get { return this.parent.EnterFolderCommand; }
            set { this.parent.EnterFolderCommand = value; }
        }

        public ICommand RemoveMyFolderCommand
        {
            get { return this.parent.RemoveFolderCommand; }
            set { this.parent.RemoveFolderCommand = value; }
        }

        public FolderItemViewModel Selected
        {
            get { return new FolderItemViewModel(this); }
        }
    }
}
